/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.yihu.wlyy.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.yihu.wlyy.entity.follow.FollowUpTemplateQuestion;

public interface FollowUpTemplateQuestionDao extends PagingAndSortingRepository<FollowUpTemplateQuestion, Long>, JpaSpecificationExecutor<FollowUpTemplateQuestion> {

	List<FollowUpTemplateQuestion> findByTemplate(String template);
	
	@Modifying
	@Query("delete from FollowUpTemplateQuestion a where a.template = ?1")
	int deleteByTemplate(String template);

}
